package com.lu.system.controller;

import com.lu.common.config.ServerConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
public class IndexController {

    @Autowired
    private ServerConfig serverConfig;

    @GetMapping("/index")
    public void index(HttpServletRequest request, HttpServletResponse response){
        try {
            System.out.println("=========="+serverConfig.getUrl());
            response.sendRedirect(serverConfig.getUrl()+"/start/index.html");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
